package brouter.compiler.utils;

import java.util.Collection;
import java.util.Map;

public class ProcessorUtil {
    public static boolean isEmpty(CharSequence str) {
        return str == null || str.length() == 0;
    }

    public static boolean isEmpty(Collection<?> coll) {
        return coll == null || coll.isEmpty();
    }

    public static boolean isEmpty(Map map) {
        return map == null || map.isEmpty();
    }

    // 首字母大写
    public static String title(String text) {
        if (text != null && text.length() > 0) {
            text = text.substring(0, 1).toUpperCase() + (text.length() > 1 ? text.substring(1) : "");
        }
        return text;
    }
}
